<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'user-form',
	'enableAjaxValidation'=>false,
        'htmlOptions' => array(
            "class" => "mainForm", 
            'enctype' => 'multipart/form-data',
        ),  
)); ?>
    <fieldset>
        <div class="widget first">
            <div class="head"><h5 class="iList"><?php echo $actionName . " User " . $model->name; ?></h5></div>
            <div class="rowElem">
                <?php echo $form->labelEx($model, 'name'); ?>
                <div class="formRight"><?php echo $form->textField($model, 'name', array('size' => 60, 'maxlength' => 255, "class"=>"rightDir", "title"=>"Username")); ?></div>
                <?php echo $form->error($model, 'name', array("style"=>"color:red")); ?>
                <div class="fix"></div>
            </div>
            <div class="rowElem">
                <?php echo $form->labelEx($model,'password'); ?>
                <div class="formRight"><?php echo $form->passwordField($model,'password',array('size'=>60,'maxlength'=>255, "class"=>"rightDir", "title"=>"Password")); ?></div>
                <?php echo $form->error($model,'password', array("style"=>"color:red")); ?>  
                <div class="fix"></div>
            </div>
            <div class="rowElem">
                <?php echo $form->labelEx($model, 'email'); ?>
                <div class="formRight"><?php echo $form->textField($model, 'email', array('size' => 60, 'maxlength' => 255, "class"=>"rightDir validate[required,custom[email]]", "title"=>"Email")); ?></div>
                <?php echo $form->error($model, 'email', array("style"=>"color:red")); ?>
                <div class="fix"></div>
            </div>           
            <div class="rowElem">
                <?php echo $form->labelEx($model, 'sex'); ?>
                <div class="formRight"><?php echo $form->dropDownList($model, "sex", User::getSexOptions()); ?></div>
                <?php echo $form->error($model, 'sex', array("style"=>"color:red")); ?>
                <div class="fix"></div>
            </div>      
            <div class="rowElem">
                <?php echo $form->labelEx($model, 'dateOfBirth'); ?>
                <div class="formRight"><?php echo $form->textField($model, 'dateOfBirth', array("class" => "datepicker")); ?></div>
                <?php echo $form->error($model, 'dateOfBirth', array("style"=>"color:red")); ?>
                <div class="fix"></div>
            </div>    
            <div class="rowElem noborder">
                <?php echo $form->labelEx($model, 'address'); ?>
                <div class="formRight"><?php echo $form->textField($model, 'address', array('size' => 60, 'maxlength' => 255, "class"=>"rightDir", "title"=>"Address")); ?></div>
                <?php echo $form->error($model, 'address', array("style"=>"color:red")); ?>
                <div class="fix"></div>
            </div>
            <div class="rowElem">
                <?php echo $form->labelEx($model, 'messageSubscribed'); ?>
                <div class="formRight"><?php echo $form->dropDownList($model, "messageSubscribed", User::getMessageSubscribedOptions()); ?></div>
                <?php echo $form->error($model, 'messageSubscribed', array("style"=>"color:red")); ?>
                <div class="fix"></div>
            </div>      
            <div class="rowElem">
                <?php echo $form->labelEx($model, 'file_upload'); ?>
                <div class="formRight"> <?php echo CHtml::activeFileField($model, 'file_upload'); ?></div>
                <?php echo $form->error($model, 'file_upload', array("style"=>"color:red")); ?>
                <div class="formRight">
                <?php 
                if ($model->avatarUrl)
                    echo CHtml::image( Yii::app()->request->baseUrl . Constant::USER_IMG_FOLDER_DISPLAY . $model->avatarUrl,"",array("width"=>"150", "height"=>"150"));
                ?>
                </div>
                <div class="fix"></div>
            </div>
                
            <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save', array("class" => "greyishBtn submitForm")); ?>
            <div class="fix"></div>
        </div>
    </fieldset>
<?php $this->endWidget(); ?>